#!/bin/bash -e

function info() {
echo Usage: `basename $0` '[-s(omatic)] in.vcf'
exit 2
}

while getopts  ":p:f:s" opt; do
	case  $opt  in
		p) out_prefix=$OPTARG;;
		f) suffix=$OPTARG;;
        s) s=-s;;
		*) info;;
	esac
done
shift $(($OPTIND - 1))


if [ $# -lt 1 ]; then info; fi

. $var


sed '/^#/d' $1|cut -f7 > $out_prefix.filter.txt
anno_filter.py $s $out_prefix.filter.txt|sed 1i\
'##INFO=<ID=filter,Number=.,Type=String,Description="high or low">' |anno_info_vcf.pl $1 - > $out_prefix.filter.vcf

$java_run/snpsift filter "(filter= 'high')" $out_prefix.filter.vcf> $out_prefix.high.vcf
$java_run/snpsift filter "(filter= 'low')" $out_prefix.filter.vcf> $out_prefix.low.vcf
. $cmd_done